﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.DTO
{
    /// <summary>
    /// 赛事表 mc_Playing
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class playing_dto
    {
        /// <summary>
        /// 赛事Id
        /// </summary>
        public long id { get; set; }

        /// <summary>
        /// 活动类型
        /// </summary>
        public EActivityType activity_type { get; set; }

        /// <summary>
        /// 活动类型枚举值描述
        /// </summary>
        public string activity_type_title { get { return this.activity_type.ToDescription(); } }

        /// <summary>
        /// 比赛模式（枚举）
        /// </summary>
        public EPlayType play_type { get; set; }

        /// <summary>
        /// 比赛模式枚举描述
        /// </summary>
        public string play_type_title { get { return this.play_type.ToDescription(); } }

        /// <summary>
        /// 比赛时间
        /// </summary>
        public DateTime play_time { get; set; }

        /// <summary>
        /// 参与截止时间
        /// </summary>
        public DateTime participation_end_time { get; set; }

        /// <summary>
        /// 主队Id
        /// </summary>
        public long home_team_id { get; set; }

        /// <summary>
        /// 客队Id
        /// </summary>
        public long guest_team_id { get; set; }

        /// <summary>
        /// 获胜队Id（平局则为0）
        /// </summary>
        public long? win_team_id { get; set; }

        /// <summary>
        /// 主队
        /// </summary>
        public virtual playing_team_dto home_team { get; set; }

        /// <summary>
        /// 客队
        /// </summary>
        public virtual playing_team_dto guest_team { get; set; }

        /// <summary>
        /// 获胜队
        /// </summary>
        public virtual playing_team_dto win_team { get; set; }

        /// <summary>
        /// 用户竞猜记录
        /// </summary>
        [JsonIgnore]
        public List<user_guess_playing_his_dto> user_Guess_Playing_Hiss { get; set; }
    }

    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class playing_dto_ex : playing_dto
    {
        /// <summary>
        /// 活动类型枚举下拉数据
        /// </summary>
        public List<DropdownItem> e_activity_type_list
        {
            get { return typeof(EActivityType).GetDropdownItemList(); }
        }
        /// <summary>
        /// 活动类型枚举值
        /// </summary>
        public string activity_type_value { get; set; }

        /// <summary>
        /// 比赛模式下拉数据
        /// </summary>
        public List<DropdownItem> e_play_type_list
        {
            get { return typeof(EPlayType).GetDropdownItemList(); }
        }
        /// <summary>
        /// 比赛模式枚举值
        /// </summary>
        public string play_type_value { get; set; }

        /// <summary>
        /// 主队Id值
        /// </summary>
        public string home_team_id_value { get; set; }

        /// <summary>
        /// 客队Id值
        /// </summary>
        public string guest_team_id_value { get; set; }

        /// <summary>
        /// 获胜队Id值
        /// </summary>
        public string win_team_id_value { get; set; }

        /// <summary>
        /// 所有队伍列表
        /// </summary>
        public List<DropdownItem> team_list { get; set; }

        /// <summary>
        /// 可选胜利队伍列表（主队、客队、平局）
        /// </summary>
        public List<DropdownItem> win_team_list { get; set; }
    }


    /// <summary>
    /// 赛事统计Model（后台使用）
    /// </summary>
    [Serializable]
    [JsonObject(MemberSerialization.OptOut)]
    public class playing_statistics_model
    {
        /// <summary>
        /// 赛事Id
        /// </summary>
        public long playing_id { get; set; }

        /// <summary>
        /// 主队
        /// </summary>
        public string home_team_title { get; set; }

        /// <summary>
        /// 主队Id
        /// </summary>
        public long home_team_id { get; set; }

        /// <summary>
        /// 客队
        /// </summary>
        public string guest_team_title { get; set; }

        /// <summary>
        /// 客队Id
        /// </summary>
        public long guest_team_id { get; set; }
        
        /// <summary>
        /// 获胜队伍
        /// </summary>
        public string win_team_title { get; set; }

        /// <summary>
        /// 获胜队伍Id
        /// </summary>
        public long? win_team_id { get; set; }

        /// <summary>
        /// 比赛时间
        /// </summary>
        public DateTime playing_time { get; set; }

        /// <summary>
        /// 主队胜参与次数
        /// </summary>
        public int participate_home_num { get; set; }

        /// <summary>
        /// 平局参与次数
        /// </summary>
        public int participate_dogfall_num { get; set; }

        /// <summary>
        /// 客队胜参与次数
        /// </summary>
        public int participate_guest_num { get; set; }

        /// <summary>
        /// 总参与红钻数
        /// </summary>
        public decimal total_participate_reddrill { get; set; }

        /// <summary>
        /// 获胜参与次数
        /// </summary>
        public int win_participate_num { get; set; }

        /// <summary>
        /// 每次获得红钻数
        /// </summary>
        public string win_reddrill_per { get; set; }
    }
}
